#ifndef AI9_LOGIC_2017_MISC_H
#define AI9_LOGIC_2017_MISC_H
#include "json/json.h"
#include <string>
#include <memory>

std::string jsonToString(const Json::Value &x);
Json::Value stringToJson(const std::string &x);

namespace misc{
    template<typename T, typename ...Args>
    std::unique_ptr<T> make_unique( Args&& ...args )
    {
        return std::unique_ptr<T>( new T( std::forward<Args>(args)... ) );
    }
}
void SplitString(const std::string& s, std::vector<std::string>& v, const std::string& c);

constexpr const double EPS = 1e-10;

#if defined(_MSC_VER)
//  Microsoft
    #define EXPORT __declspec(dllexport)
    #define IMPORT __declspec(dllimport)
#elif defined(__GNUC__)
//  GCC
#define EXPORT __attribute__((visibility("default")))
#define IMPORT
#else
//  do nothing and hope for the best?
    #define EXPORT
    #define IMPORT
    #pragma warning Unknown dynamic link import/export semantics.
#endif

#endif //AI9_LOGIC_2017_MISC_H
